Skip to content

Conversation

@ddzero2c
Copy link
Contributor

Summary

Fixes a bug where the legacy diff options vertical_split and open_in_current_tab were not working correctly.

Problem

The backward compatibility mapping was checking if fields were nil after merging with defaults, but those fields were already populated by the merge, so the legacy options were never applied.

Example of broken behavior:

require("claudecode").setup({
  diff_opts = {
    vertical_split = false,  -- This was ignored! Always got vertical split
  }
})

Solution

Changed the logic to unconditionally apply legacy option mappings when the legacy options are present. This ensures backward compatibility without complex conditional checks.

Changes:

  • vertical_split=false now correctly sets layout="horizontal"
  • vertical_split=true now correctly sets layout="vertical"
  • open_in_current_tab=false now correctly sets open_in_new_tab=true
  • open_in_current_tab=true now correctly sets open_in_new_tab=false

Testing

Manually tested all scenarios:

  • ✅ Legacy options work correctly
  • ✅ New options continue to work
  • ✅ Default behavior unchanged
  • make format passes (no changes needed)

🤖 Generated with Claude Code

The backward compatibility mapping for `vertical_split` and
`open_in_current_tab` options was not working because it checked
if the merged config had nil values, but after merging with defaults,
these fields were already populated.

Fixed by unconditionally applying the legacy option mappings when
the legacy options are present. This ensures backward compatibility
for users still using the old option names.

Fixes:
- vertical_split=false now correctly sets layout="horizontal"
- open_in_current_tab=false now correctly sets open_in_new_tab=true

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ThomasK33 ThomasK33 added this pull request to the merge queue Oct 15, 2025
Merged via the queue into coder:main with commit 6af7df0 Oct 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants